<template>
    <div class="mu-checker ion-ios-circle-outline" @click="handle">
        <input v-if="type === 'checkbox'" type="checkbox" style="display:none" v-model="checked">
        <input v-if="type === 'radio'" type="radio" style="display:none">
        <i class="mu-checker-icon" :class="check && typeIcon"></i>
    </div>
</template>

<script>
    import {
        lang,
        domStyle,
        drag
    } from 'muka'
    export default {
        name: 'mu-checkbox',
        data: function () {
            return {
                typeIcon: {
                    'ion-android-checkbox': false,
                    'ion-checkmark-circled': false,
                    'ion-checkmark-round': false,
                    'ion-ios-checkmark-outline': false,
                    'ion-ios-checkmark': false
                }
            }
        },
        props: {
            type: {
                type: String,
                default: 'checkbox'
            },
            'icon-type': {
                type: String,
                default: 'checkbox'
            },
            'disabled-item-class': String,
            checked: {
                type: Boolean,
                default: false
            }
        },
        computed: {},
        created: function () {
            let prefix = {
                'checkbox': 'ion-android-checkbox',
                'circled': 'ion-checkmark-circled',
                'round': 'ion-checkmark-round',
                'outline': 'ion-ios-checkmark-outline',
                'checkmark': 'ion-ios-checkmark'
            }
            lang.entirety(this.typeIcon, prefix[this.iconType])
        }
    }

</script>
